'use strict';

const app = require('koa')();
const config = require('./config');

require('./config/db');
require('./config/koa')(app);

if (!module.parent) {
  app.listen(config.app.port);
  console.log('ENV: ', config.app.env);
  console.log('%s is listening port: %d !!!', config.app.name, config.app.port);
}

module.exports = app;
